<?php

/**
 * Store form.
 *
 * @package    form
 * @subpackage Store
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 6174 2007-11-27 06:22:40Z fabien $
 */
class StoreForm extends BaseStoreForm
{
  public function configure()
  {
  	$this->getWidget('name')->setLabel('Store Name');
  	$this->getWidget('name')->setAttribute('size',50);
  	$this->getWidget('owner')->setAttribute('size',50);
  	$this->getWidget('phone')->setAttribute('size',50);
  	$this->getWidget('website')->setAttribute('size',50);
  	$this->getWidget('email')->setAttribute('size',50);

  	$this->getWidget('url')->setLabel('URL');
  	$this->setWidget('address', new sfExtraWidgetFormRichTextarea());
  	$this->setWidget('description', new sfExtraWidgetFormRichTextarea());

  	 unset($this['created_at'],$this['updated_at']);

  	$this->widgetSchema['logo'] = new sfWidgetFormInputFileEditable(
									array(
										'label'     => 'Company logo',
										'file_src'  => '/uploads/logos/'.$this->getObject()->getLogo(),
										'is_image'  => true,
										'edit_mode' => !$this->isNew(),
										'template'  => '<div>%file%<br />%input%<br />%delete%
										%delete_label%</div>',
										)
  									);
  	$this->validatorSchema['logo_delete'] = new sfValidatorPass();
  }
}